﻿
 
 

// ******************************************************
// 这段代码是自动生成的
// 修改里面的代码，下次生成的时候会被覆盖
// ******************************************************
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using Sharp.Application;
using Sharp.DataTransferObject;
using System.ServiceModel.Activation;
using Sharp.Infrastructure.Search;
using Sharp.ServiceContracts;
using Sharp.Infrastructure;
using Sharp.Infrastructure.IoC;
namespace Sharp.Services.Controllers
{
	public class UserServiceController : ApiController,IUserService
	{
		private readonly IUserService _impl = ServiceLocator.Instance.GetService<IUserService>();
				public Result CreateUser(UserDTO user)
		{
			 return _impl.CreateUser(user);
		}
		public Result UpdateUser(UserDTO user)
		{
			 return _impl.UpdateUser(user);
		}
		public Result SaveUser(UserDTO user)
		{
			 return _impl.SaveUser(user);
		}
		public Result DeleteUsers(IList<System.Guid> userids)
		{
			 return _impl.DeleteUsers(userids);
		}
		public Boolean ValidateUser(String userName, String password)
		{
			 return _impl.ValidateUser(userName, password);
		}
		public Boolean DisableUser(UserDTO user)
		{
			 return _impl.DisableUser(user);
		}
		public Boolean UnlockUser(String userName)
		{
			 return _impl.UnlockUser(userName);
		}
		public Boolean EnableUser(UserDTO user)
		{
			 return _impl.EnableUser(user);
		}
		public Result<UserDTO> GetUserByKey(Guid id)
		{
			 return _impl.GetUserByKey(id);
		}
		public Result<UserDTO> GetUserByEmail(String email)
		{
			 return _impl.GetUserByEmail(email);
		}
		public Result<UserDTO> GetUserByName(String userName)
		{
			 return _impl.GetUserByName(userName);
		}
		public PagedResult<UserDTO> GetUsersPaged(PagingFeature pf, System.Nullable<System.Guid> userGroupId)
		{
			 return _impl.GetUsersPaged(pf, userGroupId);
		}
		public void AssignRole(Guid userId, Guid roleId)
		{
			  _impl.AssignRole(userId, roleId);
		}
		public void UnassignRole(Guid userId)
		{
			  _impl.UnassignRole(userId);
		}
		public IEnumerable<PermissionDTO> GetPermissionByUserName(String username)
		{
			 return _impl.GetPermissionByUserName(username);
		}
		public Boolean ChangePassword(String username, String oldPassword, String newPassword)
		{
			 return _impl.ChangePassword(username, oldPassword, newPassword);
		}
		public Boolean ChangePasswordQuestionAndAnswer(String username, String password, String newPasswordQuestion, String newPasswordAnswer)
		{
			 return _impl.ChangePasswordQuestionAndAnswer(username, password, newPasswordQuestion, newPasswordAnswer);
		}
		public Result<UserDTO> TryLogin(UserDTO userDTO)
		{
			 return _impl.TryLogin(userDTO);
		}
		public void SaveLog(string log)
		{
			  _impl.SaveLog(log);
		}
		public UserLogDTO GetUserLogInfo(Guid id)
		{
			 return _impl.GetUserLogInfo(id);
		}
		public Result DeleteUserLogs(Guid[] ids)
		{
			 return _impl.DeleteUserLogs(ids);
		}
		public PagedResult<UserLogDTO> GetUserLogPaged(PagingFeature pf)
		{
			 return _impl.GetUserLogPaged(pf);
		}
		public Result RelationUser(Guid userGroupId, Guid[] userIds)
		{
			 return _impl.RelationUser(userGroupId, userIds);
		}
		public Result UnRelationUser(Guid userGroupId, Guid[] userIds)
		{
			 return _impl.UnRelationUser(userGroupId, userIds);
		}
		public IEnumerable<PermissionDTO> AllPermissions()
		{
			 return _impl.AllPermissions();
		}
		public IEnumerable<PermissionDTO> GetPermissionByGroupId(Guid guid)
		{
			 return _impl.GetPermissionByGroupId(guid);
		}
		public Result SavePermission(IList<System.Guid> ids, String owner, Guid ownerId)
		{
			 return _impl.SavePermission(ids, owner, ownerId);
		}
		public IEnumerable<PermissionDTO> GetPermissionById(Guid uid)
		{
			 return _impl.GetPermissionById(uid);
		}
		public Result UpdatePermission(IList<PermissionDTO> dtos)
		{
			 return _impl.UpdatePermission(dtos);
		}
		public IList<RoleDTO> GetRoles()
		{
			 return _impl.GetRoles();
		}
		public RoleDTO GetRoleByKey(Guid id)
		{
			 return _impl.GetRoleByKey(id);
		}
		public Result CreateRoles(RoleDTO roleDTO)
		{
			 return _impl.CreateRoles(roleDTO);
		}
		public IList<RoleDTO> UpdateRoles(IList<RoleDTO> roledtos)
		{
			 return _impl.UpdateRoles(roledtos);
		}
		public void DeleteRoles(IList<System.Guid> roleIDs)
		{
			  _impl.DeleteRoles(roleIDs);
		}
		public PagedResult<UserGroupDTO> GetUserGroupPaged(PagingFeature pf)
		{
			 return _impl.GetUserGroupPaged(pf);
		}
		public UserGroupDTO GetUserGroupByKey(Guid id)
		{
			 return _impl.GetUserGroupByKey(id);
		}
		public void CreateUserGroup(UserGroupDTO userGroupDto)
		{
			  _impl.CreateUserGroup(userGroupDto);
		}
		public Result UpdateUserGroup(UserGroupDTO userGroupDto)
		{
			 return _impl.UpdateUserGroup(userGroupDto);
		}
		public Result SaveUserGroup(UserGroupDTO userGroupDto)
		{
			 return _impl.SaveUserGroup(userGroupDto);
		}
		public Result DeleteUserGroups(IList<System.Guid> userGroupids)
		{
			 return _impl.DeleteUserGroups(userGroupids);
		}
		public Boolean CheckUserGroupName(String name)
		{
			 return _impl.CheckUserGroupName(name);
		}
		public Result<IEnumerable<UserGroupDTO>> GetUserGroups()
		{
			 return _impl.GetUserGroups();
		}

		/// <summary>
        /// 为客户端ajax跨域请求必须的方法
        /// </summary>
        /// <returns></returns>
        public string Options()
        {
            // HTTP 200 response with empty body
            return null;
        }
	}
}